<layout name="layout" />
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>个人信息</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" type="text/css" href="/public/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="/public/common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="/public/common/global.css" media="all">

</head>
<body>
<section class="layui-larry-box">
	<a href="javascript:;>" class="layui-btn layui-btn-big">
		<i class="layui-icon">&#xe613;</i>
		用户管理
	</a>
  <a href="<?php echo U('admin/add'); ?>" class="layui-btn ">
		<i class="layui-icon">&#xe61f;</i>
		新建用户
	</a>
  <table class="layui-table"  lay-skin="line">
  <thead>
    <tr>
      <th>用户名</th>
      <th>手机</th>
			<th>权限</th>
			<th>绑定项目</th>
      <th>操作</th>
    </tr>
  </thead>
  <tbody>
  	<?php foreach ($data as $k => $v): ?>
    <tr>

      <td><?php echo $v['username']; ?></td>
      <td><?php echo $v['mobile']; ?></td>
      <td><?php echo $v['privilege_id']; ?>


			</td>
      <td>
			<form action="" class="layui-form">
				<select>
					<option value="">点击查看</option>
		      <?php
		        $arr = explode(',', $v['project_id']);
		        $model = D('project');
		        foreach($arr as $k=>$v1):
		        $project_name = $model->find($v1);
		      ?>
				<option value="1"><?php echo $project_name['project_name']; ?></option>
					<?php endforeach; ?>
			</select>
			<!-- </form> -->
			</form>
    </td>

      <td>
        <!-- <button class="layui-btn layui-btn-small">编辑</button> -->
        <a class="layui-btn layui-btn-small" href="<?php echo U('edit?id='.$v['id'].'&p='.I('get.p')); ?>" title="编辑">编辑</a>
        <a class="layui-btn layui-btn-small" href="<?php echo U('setStatus?id='.$v['id'].'&s='.$v['status']); ?>" title="停用"><?php if($v['status']==1) echo "停用"; else echo "启用"; ?></a>
      </td>
    </tr>
    <?php endforeach; ?>
		<?php if(preg_match('/\d/', $page)): ?>
        <tr><td align="right" nowrap="true" colspan="99" height="30"><?php echo $page; ?></td></tr>
        <?php endif; ?>
  </tbody>
</table>
</section>
<script type="text/javascript" src="/public/common/layui/layui.js"></script>
<script type="text/javascript">
	layui.use(['form'],function(){
         var form = layui.form();
	});

</script>
</body>
</html>
